package com.zy.uml;

/**
 * @Author Gong
 * @Description 企鹅
 * @dATE 2021/11/20 21:39
 **/
public class Penguin extends Bird{
    private Climate climate;//企鹅需要生活在南极

    Penguin(String feather, Wing[] wings,Climate climate) {
        super(feather, wings);
        this.climate = climate;
    }

    /**
     * @Author GongXL
     * @Description  企鹅也可以下蛋
     * @Date 21:39 2021/11/20
     * @Param []
     * @return void
     **/
    @Override
    public void layEggs() {
        System.out.println("我生活在:"+climate.getTq());
        System.out.println("企鹅开始下蛋");
    }

    @Override
    public String toString() {
        return super.toString()+"Penguin{" +
                "climate=" + climate +
                '}';
    }
}
